package com.lyk.swap;

import java.io.Serializable;
import java.util.Date;

public class PeriodLabel implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1087819459422203700L;
	private static final String LABEL[] = { "JAN", "FEB", "MAR", "APR", "MAY",
			"JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" };
	private int year;
	private int month;

	public PeriodLabel() {
	}

	public PeriodLabel(int year, int month) {
		super();
		this.year = year;
		this.month = month;
	}

	@SuppressWarnings("deprecation")
	public PeriodLabel(Date date) {
		year = date.getYear();
		month = date.getMonth();
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public int getMonth() {
		return month;
	}

	public void setMonth(int month) {
		this.month = month;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder(LABEL[month]);
		sb.append('-');
		sb.append(year - 100);
		return sb.toString();
	}

}
